﻿<%@ Page Language="C#" validateRequest="false" MasterPageFile="~/Admin/AdminMaster.Master" AutoEventWireup="true" CodeBehind="ArticleEdit1.aspx.cs" Inherits="PeachLite.Admin.ArticleEdit1" %>

<asp:Content ID="c1" ClientIDMode="Static" ContentPlaceHolderID="cphHead" runat="server">
<script type="text/javascript" src="js/dtpk/WdatePicker.js"></script>
    <link type="text/css" rel="Stylesheet" href="js/kindeditor/themes/default/default.css" charset="utf-8" />
    <link rel="stylesheet" href="js/kindeditor/plugins/code/prettify.css" />
    <script type="text/javascript" src="js/kindeditor/kindeditor-min.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/kindeditor/lang/zh_CN.js" charset="urf-8"></script>
    <script type="text/javascript" src="js/ajaxfileupload.js"></script>
    <script type="text/javascript">
        KindEditor.ready(function (K) {
            var editor1 = K.create('#content', {
                cssPath: 'js/kindeditor/plugins/code/prettify.css',
                allowFileManager: true,
                uploadJson: 'x/fileuploader.ashx',
                fileManagerJson: 'x/filemanager.ashx'
            });
            prettyPrint();
        });


        function chkImg() {
            $.ajaxFileUpload({
                url: "x/ajax.ashx?c=" + AJAXCODE.CheckImage + "&r=" + Math.random(),
                fileElementId: "titImgFile",
                dataType: "text",
                success: function (data) {

                    alert(data);
                    if (data == null || data == "") {
                        alert("返回的数据有误！");
                        return;
                    }
                    var result = data;
                    if (data.substr(0, 1) == "<") {
                        result = $(data).html();
                    }
                    if (result.substr(0, 1) != "{") {
                        alert("返回的数据有误！");
                        return;
                    }
                    try {
                        var json = eval('(' + result + ')');
                        if (json.Success) {
                            alert(json.Url);
                            if (json.Url != null && json.Url != "") {
                                $("#titleImage").attr("src", json.Url);
                                $("#titImgPath").val(json.Url);
                            }
                        }
                        else {
                            alert(json.Message);
                        }
                    }
                    catch (e) {
                        alert(e.message);
                    }
                },
                error: function (data, status, e) {
                    alert(e);
                }
            });
        }
    </script>
</asp:Content>

<asp:Content ID="c2" ClientIDMode="Static" ContentPlaceHolderID="cphMain" runat="server">
    <div class="box box1">
        <div class="hd">
            <div class="tit">
                <i class="iconfont">&#xf044;</i> <span>文章编辑</span>
            </div>
        </div>
        <div class="bd aedit1">
            <ul class="fm fm1 clearfix">
                <li class="l">
                    <dl>
                        <dt>文章标题：</dt>
                        <dd>
                            <input type="hidden" id="articleId" runat="server" clientidmode="Static" value="" />
                            <input class="txt sm" type="text" placeholder="文章标题" runat="server" id="articleTitle" clientidmode="Static" />
                        </dd>
                    </dl>
                </li>
                <li class="r">
                    <dl>
                        <dt>副标题：</dt>
                        <dd>
                            <input class="txt sm" type="text" placeholder="副标题" runat="server" id="titleSub" clientidmode="Static" />
                        </dd>
                    </dl>
                </li>
                <li class="l">
                    <dl>
                        <dt>所属栏目：</dt>
                        <dd>
                            <select class="selt sm" runat="server" id="classId" clientidmode="Static">
                            </select>
                        </dd>
                    </dl>
                </li>
                <li class="r">
                    <dl>
                        <dt>序号：</dt>
                        <dd>
                            <input class="txt sm" type="text" placeholder="序号" runat="server" id="ordinal" clientidmode="Static"/>
                        </dd>
                    </dl>
                </li>
                <li class="l">
                    <dl>
                        <dt>作者：</dt>
                        <dd>
                            <input class="txt sm" type="text" placeholder="作者" runat="server" id="author" clientidmode="Static" />
                        </dd>
                    </dl>
                </li>
                <li class="r">
                    <dl>
                        <dt>来源：</dt>
                        <dd>
                            <input class="txt sm" type="text" placeholder="来源" runat="server" id="source" clientidmode="Static" />
                        </dd>
                    </dl>
                </li>
                <li class="l">
                    <dl>
                        <dt>创作时间：</dt>
                        <dd>
                            <input class="txt sm" type="text" placeholder="创作时间" runat="server" id="createTime" clientidmode="Static" onclick="WdatePicker({dateFmt:&#39;yyyy-MM-dd HH:mm:ss&#39;,readOnly:true});" />
                        </dd>
                    </dl>
                </li>
                <li class="r">
                    <dl>
                        <dt>跳转地址：</dt>
                        <dd>
                            <input class="txt sm" type="text" placeholder="跳转地址" runat="server" id="redirectUrl" clientidmode="Static"/>
                        </dd>
                    </dl>
                </li>
                <li >
                    <dl>
                        <dt>标题图片：</dt>
                        <dd>
                            <div class="fbtn">
                                <input type="file" id="titImgFile" name="titImgFile" onchange="chkImg();" runat="server" clientidmode="Static" />
                                <input type="hidden" id="titImgPath" runat="server" clientidmode="Static" />
                            </div>
                            <img src="resx/img/none_80.jpg" title="" alt="" id="titleImage" runat="server" clientidmode="Static" />
                        </dd>
                    </dl>
                </li>
                <li style="display:none;">
                    <dl>
                        <dt>相关图片：</dt>
                        <dd>
                            <ul class="rel clearfix">
                                <li>
                                    <div class="cn">
                                        <img class="pic" src="resx/img/buttom_0.jpg" title="" alt="" />
                                        <div class="tit clearfix">
                                            <span class="t">第5届职工运动会</span>
                                            <div class="o">
                                                <input class="btn edit" type="button" value="&#xf040;" />
                                                <input class="btn del" type="button" value="&#xf00d;"/>
                                            </div>
                                        </div>
                                        <div class="des">
                                            热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="cn">
                                        <img class="pic" src="resx/img/buttom_0.jpg" title="" alt="" />
                                        <div class="tit clearfix">
                                            <span class="t">第5届职工运动会</span>
                                            <div class="o">
                                                <input class="btn edit" type="button" value="&#xf040;" />
                                                <input class="btn del" type="button" value="&#xf00d;"/>
                                            </div>
                                        </div>
                                        <div class="des">
                                            热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="cn">
                                        <img class="pic" src="resx/img/buttom_0.jpg" title="" alt="" />
                                        <div class="tit clearfix">
                                            <span class="t">第5届职工运动会</span>
                                            <div class="o">
                                                <input class="btn edit" type="button" value="&#xf040;" />
                                                <input class="btn del" type="button" value="&#xf00d;"/>
                                            </div>
                                        </div>
                                        <div class="des">
                                            热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。热烈庆祝健之佳第5届职工运动会顺利举行。
                                        </div>
                                    </div>
                                </li>
                            </ul>
                            <div class="adr clearfix"><input type="button" class="btn btn1" value="添加"/></div>
                        </dd>
                    </dl>
                </li>
                <li>
                    <dl>
                        <dt>关键字：</dt>
                        <dd>
                            <textarea class="area sm" placeholder="关键字" runat="server" id="keyword" clientidmode="Static"></textarea>
                        </dd>
                    </dl>
                </li>
                <li>
                    <dl>
                        <dt>描述信息：</dt>
                        <dd>
                            <textarea class="area sm" placeholder="描述信息" runat="server" id="description" clientidmode="Static"></textarea>
                        </dd>
                    </dl>
                </li>
                <li>
                    <dl>
                        <dt>文章摘要：</dt>
                        <dd>
                            <textarea class="area" placeholder="文章摘要" runat="server" id="summary" clientidmode="Static"></textarea>
                        </dd>
                    </dl>
                </li>
                <li>
                    <dl>
                        <dt>文章内容：</dt>
                        <dd>
                            <textarea cols="100" name="content" id='content' runat="server" clientidmode="Static" style="width: 100%; height: 200px; visibility: hidden;"></textarea>
                        </dd>
                    </dl>
                </li>
                <li>
                    <dl>
                        <dt>&nbsp;</dt>
                        <dd class="op clearfix">
                            <input class="btn btn3" type="button" value="返回" onclick="javascript:history.go(-1);" />
                            <input class="btn btn1" type="reset" value="重置" />
                            <asp:Button CssClass="btn btn2" runat="server" Text="保存" ClientIDMode="Static" OnClick="saveArticle_Click"/>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
</asp:Content>